﻿@model IEnumerable<sBlog.Net.Domain.Entities.PostEntity>
<ul style="list-style-type: none; background-color: #cbf2fd; margin-top: 15px;">
    @{
        int i = 1;
    }
    @foreach (var post in Model)
    {
            
        <li>
            @{if (i == 1)
              {
                @Html.Partial("PostRecent", post)
              }
              else
              {
                  var url = Url.RouteUrl("IndividualPost", new { year = post.PostYear, month = post.PostMonth, url = post.PostUrl, status = string.Empty });
                  var shortTitle = post.PostTitle.Length > 60 ? string.Format("{0}...", post.PostTitle.Substring(0, 40)) : post.PostTitle;
                  var avatar = string.Empty;
                  if (post.PostAvatarSquare == string.Empty || post.PostAvatarSquare == null || post.PostAvatarSquare.Trim() == "")
                  {
                      avatar = post.PostAvatar;
                  }
                  else
                  {
                      avatar = post.PostAvatarSquare;
                  }
                <div class="postMostView">
                    <div class="imgLeft">
                        <a href="@url">
                            <img src="@Url.Content("http://s1.img.yan.vn/Mlog/UploadThumbs/80x80_" + @avatar)" style="border: none 0;" alt="avatar"/></a>
                    </div>
                    <div class="textRight">
                        <a href="@url" title="@post.PostTitle">@shortTitle</a>
                        <br />
                        <div class="boxAuthorViewLike" style="border: 0 none !important;">
                            <span class="posted" style="float: left;">
                                <img src="@Url.Content("~/Content/Images/MlogThem/IconView.png")" width="17" height="12" alt="View count"/>&nbsp;@Html.Raw(post.ViewCount.ToString())&nbsp;
                                <img src="@Url.Content("~/Content/Images/MlogThem/heart-follow.png")" width="12" height="12" alt="like count"/>&nbsp;@Html.Raw(post.LikeCount.ToString())
                            </span>
                        </div>
                    </div>
                </div>
              }
              i++;
            }
        </li>
    }
</ul>
